using Godot;
using System;
using Dictionary = Godot.Collections.Dictionary;
public class FurnaceBlockEntity : BlockEntity
{
    public Store store = new Store(3);
    public int RecipeId = -1;
    public int FuelTick = 0;
    public int Pace = 0;
    public const int MaxPace = 100;
    public FurnaceBlockEntity()
    {
        store.input = new int[] { 0 };
        store.fuel = new int[] { 1 };
        store.output = new int[] { 2 };
    }
    public override Dictionary getDict()
    {
        Dictionary dict = new Dictionary();
        dict.Add("store", store.getDict());
        dict.Add("FuelTick", FuelTick);
        dict.Add("Pace", Pace);
        dict.Add("RecipeId", RecipeId);
        return dict;
    }
    public override BlockEntity JsonTo(Dictionary dict)
    {
        FuelTick = dict["FuelTick"].ToInt();
        Pace = dict["Pace"].ToInt();
        RecipeId = dict["RecipeId"].ToInt();
        if (dict.Contains("store")) this.store.JsonTo((Dictionary)dict["store"]);
        return this;
    }
    public override String toJson()
    {
        return JSON.Print(getDict());
    }

    public override Store GetStore()
    {
        return store;
    }
    
}